<template>
	<view>
		<uni-list v-if="!isLoginOn">
			<view class="login">
				<navigator url="../login/login">
					<uni-list-item title="点击登录" note="欢迎使用币胜客"></uni-list-item>
				</navigator>
			</view>
		</uni-list>
		<uni-list v-else>
			<view class="login" @click="logout">
				<uni-list-item title="点击退出" note="欢迎使用币胜客"></uni-list-item>
			</view>
		</uni-list>
		<view class="recharge">
			<!-- <view class="item-active">Okex</view> -->
			<!-- 	<view class="item-forbidden">Huobi</view>
			<view class="item-forbidden">Binance</view> -->
		</view>
		<uni-list>
			<view class="setting">
				<uni-list-item v-if="isLoginOn" title="帐号切换" v-on:click="navTo('/pages/assets/accounts')" show-extra-icon="true"
				 :extra-icon="{size: '20',type: 'locked'}"></uni-list-item>
				<!-- 				<uni-list-item title="仓位管理" v-on:click="navTo('/pages/ucenter/setting/position')" show-extra-icon="true" :extra-icon="{size: '20',type: 'locked'}"></uni-list-item>
				<uni-list-item title="风控管理" v-on:click="navTo('/pages/ucenter/setting/risk')" show-extra-icon="true" :extra-icon="{size: '20',type: 'info-filled'}"></uni-list-item>
				<uni-list-item title="交易计划" v-on:click="navTo('/pages/ucenter/setting/plan')" show-extra-icon="true" :extra-icon="{size: '20',type: 'info-filled'}"></uni-list-item>
				<uni-list-item title="参数配置" v-on:click="navTo('/pages/ucenter/setting/param')" show-extra-icon="true" :extra-icon="{size: '20',type: 'contact'}"></uni-list-item> -->
				
				<uni-list-item title="加入社群" v-on:click="navTo('/pages/ucenter/setting/contact')" show-extra-icon="true" :extra-icon="{size: '20',type: 'weixin'}"></uni-list-item>
				<uni-list-item title="Okex注册" v-on:click="navTo('/pages/ucenter/setting/okexbase')" show-extra-icon="true" :extra-icon="{size: '20',type: 'home'}"></uni-list-item>
				<uni-list-item title="新手入门" v-on:click="navTo('/pages/ucenter/setting/newjoiner')" show-extra-icon="true" :extra-icon="{size: '20',type: 'navigate'}"></uni-list-item>
				<uni-list-item title="版本检测" v-on:click="navTo('/pages/ucenter/setting/checkversion')" show-extra-icon="true" :extra-icon="{size: '20',type: 'gear'}"></uni-list-item>
			</view>
		</uni-list>
		<view v-if="isLoginOn" class="flex margin-top-lg padding-left-lg">
			<button class="cu-btn round bg-blue" @tap="copy">复制推广链接</button>
		</view>
	</view>
</template>

<script>
	var _self
	import {
		uniList,
		uniListItem,
		uniIcon
	} from '@dcloudio/uni-ui'
	export default {
		props: {
			isLoginOn: false
		},
		components: {
			uniList,
			uniListItem,
			uniIcon
		},

		mounted() {
			_self = this
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			logout() {
				uni.removeStorageSync("XAUTHTOKEN")
				uni.$emit('freshLogin')
				uhi.$emit('freshUser')
				this.isLoginOn = false
			},
			copy() {
				if (_self.getShareUrl() == null || _self.getShareUrl() == '') {					
					uni.showToast({
						title:'请重新登录'
					})
				} else {
					uni.setClipboardData({
						data: _self.getShareUrl(),
						success: function() {							
							uni.showToast({
								title:'复制成功'
							})
						}
					});
				}
			}			
		}
	}
</script>

<style lang='scss'>
	.login {
		background: #f7f6fb;
	}

	.login .uni-list-item__container {
		padding-top: 40upx;
		padding-bottom: 40upx;
	}

	.login .uni-list-item__container .uni-list-item__content-title {
		font-size: $font-xl !important;
	}

	.login .uni-list-item__container .uni-list-item__content-note {
		font-size: $font-base !important;
	}

	.setting .uni-list-item__container {
		padding: 30upx 20upx;
	}

	.setting .uni-list-item__container .uni-list-item__content-title {
		font-size: $font-base !important;
	}

	.recharge {
		height: 80upx;
		line-height: 80upx;
		display: flex;
	}

	.recharge .item {
		width: 50%;
		text-align: center;
		padding-top: 20upx;
	}


	.recharge .item-active {
		width: 50%;
		text-align: center;
		padding-top: 20upx;
		border-bottom: #004085 4upx solid;
	}

	.recharge .item-forbidden {
		width: 50%;
		text-align: center;
		padding-top: 20upx;
		color: #E4E3E3;
		/* border-bottom:#004085 4upx solid ; */
	}
</style>
